package cn.zane.designPattern.createPatterns.factoryMethodPatterns.design;

import cn.zane.designPattern.createPatterns.factoryMethodPatterns.design.store.ICommodity;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: zane
 * @Date: 2024/12/25
 * @Description:
 */
public class FactoryMethodModeMain {

    public static void main(String[] args) throws Exception {
        StoreFactory storeFactory = new StoreFactory();

        // 1.优惠券
        ICommodity commodityService_1 = storeFactory.getCommodityService(1);
        commodityService_1.sendCommodity("1001", "ZANE1qo23eu1908u4109238190381", "12381231311", null);

        // 2.实物商品
        ICommodity commodityService_2 = storeFactory.getCommodityService(2);
        Map<String, String> extMap = new HashMap<>();
        extMap.put("consigneeUserName", "zane");
        extMap.put("consigneeUserPhone", "01234567891");
        extMap.put("consigneeUserAddress", "中国");
        commodityService_2.sendCommodity("1002", "ZANE1qo23eu1908u4109238190382", "12381231312", extMap);

        // 3.第三方兑换卡(模拟爱奇艺)
        ICommodity commodityService_3 = storeFactory.getCommodityService(3);
        commodityService_3.sendCommodity("1003", "ZANE1qo23eu1908u4109238190383", null, null);
    }
}
